/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * panelAntenas.java
 *
 * Created on 25/07/2011, 02:37:57
 */
package interfaz;

/**
 *
 * @author Pablo
 */
import java.awt.Graphics;  

import java.awt.Graphics2D;  

import java.awt.Image;  

import javax.swing.Icon;  

import javax.swing.ImageIcon;  

import javax.swing.JPanel;/**  

 *  

 * @author Edisoncor  

 */  

public class panelAntenas extends JPanel{  

private Image image=null;  

    private Icon icon;  

/** Creates a new instance of JEImagePanel */  

    public panelAntenas() {  
        initComponents();
        setSize(350,350);
    }  

protected void paintComponent(Graphics g) {  

        Graphics2D g2 =(Graphics2D) g;  

        if(getImage()!=null)  

            g2.drawImage(getImage(), 0, 0, getWidth(), getHeight(), null);  

    }  

public Image getImage() {  

        return image;  

    }  

public void setImage(Image image) {  

        this.image = image;  

    }  

public Icon getIcon() {  

        return icon;  

    }  

public void setIcon(Icon icon){  

        this.icon=icon;  

        setImage(((ImageIcon)icon).getImage());  

    }  


    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setPreferredSize(new java.awt.Dimension(350, 350));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 388, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
